/**
 * @license
 * Copyright JINSCOP. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@import './default-buttons';

@mixin btn-outline() {
  .btn.btn-outline-primary {
    @include btn-outline-primary();
  }

  .btn.btn-outline-warning {
    @include btn-outline-warning();
  }

  .btn.btn-outline-success {
    @include btn-outline-success();
  }

  .btn.btn-outline-info {
    @include btn-outline-info();
  }

  .btn.btn-outline-danger {
    @include btn-outline-danger();
  }

  .btn.btn-outline-secondary {
    @include btn-outline-secondary();
  }
}

@mixin btn-outline-primary() {
  @include btn-outline-primary-border();
  @include btn-outline-fg();
  @include btn-outline-bg();
  @include btn-outline-primary-focus();
  @include btn-outline-primary-hover();
  @include btn-outline-primary-active();
}

@mixin btn-outline-warning() {
  @include btn-outline-warning-border();
  @include btn-outline-fg();
  @include btn-outline-bg();
  @include btn-outline-warning-focus();
  @include btn-outline-warning-hover();
  @include btn-outline-warning-active();
}

@mixin btn-outline-success() {
  @include btn-outline-success-border();
  @include btn-outline-fg();
  @include btn-outline-bg();
  @include btn-outline-success-focus();
  @include btn-outline-success-hover();
  @include btn-outline-success-active();
}

@mixin btn-outline-info() {
  @include btn-outline-info-border();
  @include btn-outline-fg();
  @include btn-outline-bg();
  @include btn-outline-info-focus();
  @include btn-outline-info-hover();
  @include btn-outline-info-active();
}

@mixin btn-outline-danger() {
  @include btn-outline-danger-border();
  @include btn-outline-fg();
  @include btn-outline-bg();
  @include btn-outline-danger-focus();
  @include btn-outline-danger-hover();
  @include btn-outline-danger-active();
}

@mixin btn-outline-secondary() {
  @include btn-outline-secondary-border();
  @include btn-outline-fg();
  @include btn-outline-bg();
  @include btn-outline-secondary-focus();
  @include btn-outline-secondary-hover();
  @include btn-outline-secondary-active();

  &:focus, &.focus,
  &:hover, &.hover,
  &:active, &.active {
    @include btn-outline-fg();
  }
}

@mixin btn-outline-border($color) {
  border: 2px solid $color;
}

@mixin btn-outline-fg() {
  color: nb-theme(btn-outline-fg);
}

@mixin btn-outline-bg() {
  background-color: transparent;
}

// Hover
@mixin btn-outline-primary-hover() {
  @include btn-primary-hover();
}

@mixin btn-outline-warning-hover() {
  @include btn-warning-hover();
}

@mixin btn-outline-success-hover() {
  @include btn-success-hover();
}

@mixin btn-outline-info-hover() {
  @include btn-info-hover();
}

@mixin btn-outline-danger-hover() {
  @include btn-danger-hover();
}

@mixin btn-outline-secondary-hover() {
  @include btn-secondary-hover();
}

// Focus
@mixin btn-outline-primary-focus() {
  @include btn-outline-focus(btn-focus-color(btn-primary-bg, 20%));
}

@mixin btn-outline-warning-focus() {
  @include btn-outline-focus(btn-focus-color(btn-warning-bg, 20%));
}

@mixin btn-outline-success-focus() {
  @include btn-outline-focus(btn-focus-color(btn-success-bg, 20%));
}

@mixin btn-outline-info-focus() {
  @include btn-outline-focus(btn-focus-color(btn-info-bg, 20%));
}

@mixin btn-outline-danger-focus() {
  @include btn-outline-focus(btn-focus-color(btn-danger-bg, 20%));
}

@mixin btn-outline-secondary-focus() {
  @include btn-outline-focus(btn-focus-color(btn-secondary-border, 20%));
}


// Active
@mixin btn-outline-primary-active() {
  @include btn-primary-active();
}

@mixin btn-outline-warning-active() {
  @include btn-warning-active();
}

@mixin btn-outline-success-active() {
  @include btn-success-active();
}

@mixin btn-outline-info-active() {
  @include btn-info-active();
}

@mixin btn-outline-danger-active() {
  @include btn-danger-active();
}

@mixin btn-outline-secondary-active() {
  @include btn-secondary-active();
}


// Border
@mixin btn-outline-primary-border() {
  @include btn-outline-border(nb-theme(btn-primary-bg));
}

@mixin btn-outline-warning-border() {
  @include btn-outline-border(nb-theme(btn-warning-bg));
}

@mixin btn-outline-success-border() {
  @include btn-outline-border(nb-theme(btn-success-bg));
}

@mixin btn-outline-info-border() {
  @include btn-outline-border(nb-theme(btn-info-bg));
}

@mixin btn-outline-danger-border() {
  @include btn-outline-border(nb-theme(btn-danger-bg));
}

@mixin btn-outline-secondary-border() {
  @include btn-outline-border(nb-theme(btn-secondary-border));
}
